// Copyright (C) 2008 Taylor L. Riche <riche@cs.utexas.edu>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

#ifndef APPLICATION_H_
#define APPLICATION_H_

#include "Reader.h"
#include "System.h"
#include "commands.h"
#include "Monitor.h"
#include <vector>

namespace lagniappe
{

class Application
{
protected:
        // TLR: OPT
	std::vector<CoreOp *> opVec;
	virtual void schedule(System * sys) = 0;
	virtual void buildOperators(System * sys, void * arg_struct, bool prof = false) = 0;
	virtual void connectGraph() = 0;
	void activateMonitor(System * sys);
public:
	Application();
	virtual ~Application();
	void setup(System * sys, void * arg_struct = NULL);
	void setupProfiler(System * sys);
	void startLoop(System * sys);
	// TLR: OPT
//	inline CoreOp * lookupOperator(std::string opName) {return opMap[opName];}
	inline CoreOp * lookupOperator(uint32_t opNum) {return opVec.at(opNum);}
};

}

#endif /*APPLICATION_H_*/
